package info.mrchen.gae.weibo2mail.controller;

import info.mrchen.gae.weibo2mail.dao.TwitterWeiboDao;
import info.mrchen.gae.weibo2mail.pojo.SavedAccessToken;

import java.util.List;
import java.util.logging.Logger;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

@Controller
public class WelcomeController {
    private static final Logger logger = Logger.getLogger(WelcomeController.class.getName());
    UserService userService = UserServiceFactory.getUserService();

    @Autowired
    TwitterWeiboDao twitterWeiboDao;

    @RequestMapping("/Welcome.do")
    public void welcome() {

    }

    @RequestMapping("/weibo/Welcome.do")
    public void weiboWelcome() {
        List<SavedAccessToken> accounts = twitterWeiboDao.getAccount(userService.getCurrentUser());

    }

    @RequestMapping("/hello/{name}.do")
    public String welcome1(@PathVariable String name, Model model) {
        model.addAttribute("name", name);
        return "welcome";
    }

}
